package com.google.code.irouter.servlet;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.google.code.irouter.utils.CacheUtil;
import com.google.code.irouter.utils.ModelUtil;

public final class Startup extends Service {

	@Override
	protected void execute(ServletConfig servletConfig) throws ServletException {
		WebApplicationContext context = WebApplicationContextUtils
				.getWebApplicationContext(servletConfig.getServletContext());
		ModelUtil.setDatastore(context.getBean("DATASTORE_SERVICE"));		
		CacheUtil.setCACHE(context.getBean("CACHE"));
	
	}

}
